const http = require('../utils/http')

const HTTP = new http.HTTP()

// 获取活动详情
export function getActivity(id, callback) {
  let params = {}
  HTTP.request('/activity/info/' + id, 'GET', params, res => {
    callback(res)
  })
}
export function jobListByActivityId(id, callback) {
  let params = {}
  HTTP.request('/job/list/' + id, 'GET', params, res => {
    callback(res)
  })
}

// 获取活动留言
export function getMessage(id, pageNum, pageSize, callback) {
  let params = {
    pageNum,
    pageSize
  }
  HTTP.request('/message/activityContent/' + id, 'GET', params, res => {
    callback(res)
  })
}
// 获取风采

export function getActivityContentMessage(id, pageNum, pageSize, callback) {
  let params = {
    pageNum,
    pageSize
  }
  HTTP.request('/comment/activityContent/' + id, 'GET', params, res => {
    callback(res)
  })
}


// 写留言
export function addMsg(obj, callback) {
  let params = obj
  console.log(params)
  HTTP.request('/message/post', 'POST', params, res => {
    callback(res)
  })
}
// 写风采留言
export function addContentMsg(obj, callback) {
  let params = obj
  console.log(params)
  HTTP.request('/comment/post', 'POST', params, res => {
    callback(res)
  })
}

// 活动报名
export function joinActivity(params, callback) {

  HTTP.request('/activity/joinActivity', 'POST', params, res => {
    callback(res)
  })
}
export function activityGetOne(params,callback){

  HTTP.request("/activity/getOne","GET",params,res=>{
    callback(res)
  })
}

export function activityBuyActivity(params,callback) {

  HTTP.request("/activity/buyActivity","POST",params,res=>{
    callback(res)
  })
}
